<html>
<head>
	<link type="text/css" rel="stylesheet" href="../css/default.css" />
    <link type="text/css" rel="stylesheet" href="../js/rainbow/themes/sunburst.css">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
	<div class="page">
<h2>IgeMap2d <span>CLASS</span></h2>
<p>Declared in <a href="../../engine/core/IgeMap2d.js">IgeMap2d.js</a></p>
<div class="itemBox">
	<div class="header">Description</div>
	<div class="content">Creates a new map that has two dimensions (x and y) to it's data.</div>
</div>
<!--=if{extends}[-->
<div class="itemBox">
	<div class="header">Extends</div>
	<div class="content"><a href="IgeClass.html">IgeClass</a></div>
</div>
<!--=if{extends}]-->
<h2>Methods</h2><a name="tileData"></a>
<h3 class="methodTitle">tileData</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets a value on the specified map tile co-ordinates.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">tileData</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">*</span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">*</span>}<span class="argName">val</span> The data to set on the map tile co-ordinate.</li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="clearData"></a>
<h3 class="methodTitle">clearData</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Clears any data set at the specified map tile co-ordinates.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">clearData</span>({<span class="argType"></span>} <span class="argName">x</span>, {<span class="argType"></span>} <span class="argName">y</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">x</span> </li><li>{<span class="argType"></span>}<span class="argName">y</span> </li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">Boolean</span>} True if data was cleared or false if no data existed.</div>
    
</div><a name="collision"></a>
<h3 class="methodTitle">collision</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Checks if the tile area passed has any data stored in it. If so, returns true, otherwise false.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">collision</span>({<span class="argType"></span>} <span class="argName">x</span>, {<span class="argType"></span>} <span class="argName">y</span>, {<span class="argType"></span>} <span class="argName">width</span>, {<span class="argType"></span>} <span class="argName">height</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">x</span> </li><li>{<span class="argType"></span>}<span class="argName">y</span> </li><li>{<span class="argType"></span>}<span class="argName">width</span> </li><li>{<span class="argType"></span>}<span class="argName">height</span> </li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="collisionWith"></a>
<h3 class="methodTitle">collisionWith</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Checks if the tile area passed has data stored in it that matches the passed data. If so, returns true, otherwise false.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">collisionWith</span>({<span class="argType"></span>} <span class="argName">x</span>, {<span class="argType"></span>} <span class="argName">y</span>, {<span class="argType"></span>} <span class="argName">width</span>, {<span class="argType"></span>} <span class="argName">height</span>, {<span class="argType"></span>} <span class="argName">data</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">x</span> </li><li>{<span class="argType"></span>}<span class="argName">y</span> </li><li>{<span class="argType"></span>}<span class="argName">width</span> </li><li>{<span class="argType"></span>}<span class="argName">height</span> </li><li>{<span class="argType"></span>}<span class="argName">data</span> </li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="collisionWithOnly"></a>
<h3 class="methodTitle">collisionWithOnly</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Checks if the tile area passed has data stored in it that matches the passed data and does not collide with any other stored tile data. If so, returns true, otherwise false.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">collisionWithOnly</span>({<span class="argType"></span>} <span class="argName">x</span>, {<span class="argType"></span>} <span class="argName">y</span>, {<span class="argType"></span>} <span class="argName">width</span>, {<span class="argType"></span>} <span class="argName">height</span>, {<span class="argType"></span>} <span class="argName">data</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">x</span> </li><li>{<span class="argType"></span>}<span class="argName">y</span> </li><li>{<span class="argType"></span>}<span class="argName">width</span> </li><li>{<span class="argType"></span>}<span class="argName">height</span> </li><li>{<span class="argType"></span>}<span class="argName">data</span> </li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="mapData"></a>
<h3 class="methodTitle">mapData</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Gets / sets the map's tile data.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">mapData</span>({<span class="argType">Array</span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Array</span>}<span class="argName">val</span> The map data array.</li></ul></div>
    <div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
    
</div><a name="mapDataString"></a>
<h3 class="methodTitle">mapDataString</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Returns a string of the map's data in JSON format.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">mapDataString</span>()</div>
    <div class="methodArgs"></div>
    <div class="methodReturnDesc">Returns {<span class="argType">String</span>} </div>
    
</div><a name="insertMapData"></a>
<h3 class="methodTitle">insertMapData</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Inserts map data into the map at the given co-ordinates. Please note this is not used for setting a tile's value. This is used to add large sections of map data at the specified co-ordinates. To set an individual tile value, please use tile(x, y, val).</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">insertMapData</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Array</span>} <span class="argName">val</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Array</span>}<span class="argName">val</span> The map data array.</li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div><a name="rotateData"></a>
<h3 class="methodTitle">rotateData</h3>
<div class="methodSection">
    <!--=if{desc}[-->
    <div class="methodDesc">Rotates map data either -90 degrees (anti-clockwise), 90 degrees (clockwise) or 180 degrees. Useful when you want to define one section of a map and then re-use it in slightly different layouts.</div>
    <!--=if{desc}]-->
    <div class="methodDefinition"><span class="methodName">rotateData</span>({<span class="argType">Array</span>} <span class="argName">val</span>, {<span class="argType">Number</span>} <span class="argName">mode</span>)</div>
    <div class="methodArgs"><ul class="argList"><li>{<span class="argType">Array</span>}<span class="argName">val</span> The map data array to rotate.</li><li>{<span class="argType">Number</span>}<span class="argName">mode</span> Either -90, 90 or 180 to denote the type of rotation to perform.</li></ul></div>
    <div class="methodReturnDesc"></div>
    
</div>	</div>
    <script type="text/javascript">
        $(function () {
            $('code').attr('data-language', 'javascript');
        });
    </script>
    <script type="text/javascript" src="../js/rainbow/rainbow-custom.min.js"></script>
</body>
</html>